import {Button, Card, Checkbox, Col, DatePicker, Form, Input, InputNumber, Row, Select, Table, Tabs} from "antd";
import React from "react";
import BaseComponent from "../../redare/components/BaseComponent";


export default class GenPathForm extends BaseComponent {

    formRef = React.createRef();

    constructor(props) {
        super(props);
        this._form.extraValue = {};
    }

    validateFormFields() {
        return new Promise((resolve, reject) => {
            this.formRef.current.validateFields().then((values) => {
                let resultValues = {...values, ...this._form.extraValue}
                resolve(resultValues);
            }).catch((errorInfo) => {
                reject(errorInfo);
            });
        });
    }

    setFormData(data) {
        if (this.formRef.current && data) {
            this.formRef.current.setFieldsValue(data);
        }
    }

    resetFormFields() {
        if (this.formRef.current) {
            this.formRef.current.resetFields();
        }
    }

    render() {
        return (
            <div>
                <Form labelCol={{span: 6}} ref={this.formRef}>
                    <Row gutter={[24, 24]}>
                        <Col span={24}>
                            <Form.Item
                                name={"outputPath"}
                                label="生成路径"
                                rules={[{required: true, message: '请输入生成路径'}]}
                            >
                                <Input placeholder="请输入生成路径"/>
                            </Form.Item>
                        </Col>
                        <Col span={24}>
                            <Form.Item
                                name={"basePackage"}
                                label="包名称"
                                rules={[{required: false, message: '请输入包名称'}]}
                            >
                                <Input placeholder="请输入包名称"/>
                            </Form.Item>
                        </Col>
                    </Row>
                </Form>
            </div>
        )
    }
}







